<%--

<!------------------------------------------------------------------------------
 - Copyright 2006 CORE Solutions Limited
 - All rights reserved.
 - PROPRIETARY AND CONFIDENTIAL INFORMATION.
 - Use is subject to license terms.
 -
 - FUNCTION ID      :   COMPANY
 - AUTHOR           :   Victor Zheng 
 - DATE CREATE      :   2006/02/01
 - DESCRIPTION      :   a HEADER TAB JSP file for the function, COMPANY
 -                  :   
 -                  :   
 -                  :   
 -
 - MODIFICATION HISTORY:
 - DATE         AUTHOR          VERSION NO.         COMMENT
 - -----------  --------------  ------------------  -------------------
 - 2006/02/01   Victor Zheng    1.0                 source is generated.
 -
 -
 -
------------------------------------------------------------------------------->

--%>
<%@ include file="/jsp/com/erp/app/common/jsp/directives_include.jsp"%>

<%@ page import="com.erp.app.admin.companySetup.vo.CompanyVo"%>
<%@ page import="com.erp.app.admin.companySetup.web.CompanyMaintenanceAction"%>
<%@ page import="com.erp.app.admin.companySetup.web.CompanyMaintenanceForm"%>

<%@ include file="/jsp/com/erp/app/common/jsp/html_include.jsp"%>

<jsp:useBean id="companyMaintenanceForm" scope="session" type="com.erp.app.admin.companySetup.web.CompanyMaintenanceForm" />

<!-- MUST use the following example to mark fields as mandatory field inputs-->
<!--
<td class="grid_header" nowrap><span class="mandatory_label">
<bean:message key="label.general.mandatory.field"/>
...</span></td>
-->
<%
formReadOnly = false;
TableSchema ts = companyMaintenanceForm.getTs();
%>

<table class="table_header">

	<tr>
		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_COMPANY_CODE");
		colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_COMPANY_CODE"));
		displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_COMPANY_CODE"));
		%>
		<td class="col_label">
			<bean:message key="label.general.mandatory.field"/>
			<span class="mandatory_label"><%=webLabel%></span>
		</td>
		<td class="col_value" nowrap>
			<logic:equal name = "companyMaintenanceForm" property = "pageMode" value = "<%=companyMaintenanceForm.PAGE_MODE_CREATE%>">
				<html:text property="companyCode" styleClass="textbox1" readonly="<%=formReadOnly%>" maxlength="<%=colSize%>" size="<%=displaySize%>" value="<%=CommonUtil.nullToString(companyMaintenanceForm.getCompanyCode())%>"/>
			</logic:equal>
			<logic:notEqual name = "companyMaintenanceForm" property = "pageMode" value = "<%=companyMaintenanceForm.PAGE_MODE_CREATE%>">
				<bean:write name = "companyMaintenanceForm" property="companyCode" filter="true"/>
			</logic:notEqual>
		</td>
		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_SHORT_NAME");
		colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_SHORT_NAME"));
		displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_SHORT_NAME"));
		%>
		<td class="col_label">
			<bean:message key="label.general.mandatory.field"/>
			<span class="mandatory_label"><%=webLabel%></span>
		</td>
		<td class="col_value" nowrap>
			<html:text property="shortName" styleClass="textbox1" readonly="<%=formReadOnly%>" maxlength="<%=colSize%>" size="<%=displaySize%>" value="<%=CommonUtil.nullToString(companyMaintenanceForm.getShortName())%>"/>
		</td>
	</tr>
	<tr>
		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_LONG_NAME");
		colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_LONG_NAME"));
		displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_LONG_NAME"));
		%>
		<td class="col_label">
			<bean:message key="label.general.mandatory.field"/>
			<span class="mandatory_label"><%=webLabel%></span>
		</td>
		<td class="col_value" nowrap>
			<html:text property="longName" styleClass="textbox1" readonly="<%=formReadOnly%>" maxlength="<%=colSize%>" size="<%=displaySize%>" value="<%=CommonUtil.nullToString(companyMaintenanceForm.getLongName())%>"/>
		</td>	
		<td class="col_label">
			&nbsp;
		</td>
		<td class="col_value" nowrap>
			&nbsp;
		</td>	
	</tr>
	<tr>
		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_ADDR1");
		colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_ADDR1"));
		displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_ADDR1"));
		%>
		<td class="col_label">
			<bean:message key="label.general.mandatory.field"/>
			<span class="mandatory_label"><%=webLabel%></span>
		</td>
		<td class="col_value" nowrap>
			<html:text property="addr1" styleClass="textbox1" readonly="<%=formReadOnly%>" maxlength="<%=colSize%>" size="<%=displaySize%>" value="<%=CommonUtil.nullToString(companyMaintenanceForm.getAddr1())%>"/>
		</td>
		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_COUNTRY");
		colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_COUNTRY"));
		displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_COUNTRY"));
		%>
		<td class="col_label">
			<bean:message key="label.general.mandatory.field"/>
			<span class="mandatory_label"><%=webLabel%></span>
		</td>
		<td class="col_value" nowrap>
			<select name="country" <%=formReadOnly ? "disabled=\"true\"" : ""%> class="selectBox1">
			<% where = "ref_master_code='" + ProjectConstants.CD_COUNTRY + "' AND COMPANY_CODE = '"+WebUtil.getAppropriateCompanyCode(session, null) + "' AND REF_STATUS = '"+ProjectConstants.GENERIC_ACTIVE+"' ";%>
				<option value="">
				<chtml:options table="T_CODE_DTL"
				valuecolumn="REF_CODE"
				textcolumn="REF_DESC"
				where= "<%=where%>"
				order="REF_DESC"
				selected="<%=companyMaintenanceForm.getCountry()%>" />
			</select>
		</td>
	</tr>
	<tr>
		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_ADDR2");
		colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_ADDR2"));
		displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_ADDR2"));
		%>
		<td class="col_label">
			<%=webLabel%>
		</td>
		<td class="col_value" nowrap>
			<html:text property="addr2" styleClass="textbox1" readonly="<%=formReadOnly%>" maxlength="<%=colSize%>" size="<%=displaySize%>" value="<%=CommonUtil.nullToString(companyMaintenanceForm.getAddr2())%>"/>
		</td>
		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_PHONE");
		%>
		<td class="col_label">
			<bean:message key="label.general.mandatory.field"/>
			<span class="mandatory_label"><%=webLabel%></span>
		</td>
		<td class="col_value" nowrap>
			<%--
			<html:text property="phone" styleClass="textbox1" readonly="<%=formReadOnly%>" maxlength="<%=colSize%>" size="<%=displaySize%>" value="<%=CommonUtil.nullToString(companyMaintenanceForm.getPhone())%>"/>
			--%>
			<nobr>
			<%
			colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_PHONE_COUNTRY"));
			displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_PHONE_COUNTRY"));
			%>
			<html:text property="phoneCountry" styleClass="textbox1" readonly="<%=formReadOnly%>" size="<%=displaySize%>" maxlength="<%=colSize%>" value="<%=CommonUtil.nullToString(companyMaintenanceForm.getPhoneCountry())%>"/>
			+
			<%
			colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_PHONE_AREA"));
			displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_PHONE_AREA"));
			%>
			<html:text property="phoneArea" styleClass="textbox1" readonly="<%=formReadOnly%>" size="<%=displaySize%>" maxlength="<%=colSize%>" value="<%=CommonUtil.nullToString(companyMaintenanceForm.getPhoneArea())%>"/>
			+
			<%
			colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_PHONE"));
			displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_PHONE"));
			%>
			<html:text property="phone" styleClass="textbox1" readonly="<%=formReadOnly%>" size="<%=displaySize%>" maxlength="<%=colSize%>" value="<%=CommonUtil.nullToString(companyMaintenanceForm.getPhone())%>"/>
			</nobr>
		</td>
	</tr>
	<tr>
		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_ADDR3");
		colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_ADDR3"));
		displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_ADDR3"));
		%>
		<td class="col_label">
			<%=webLabel%>
		</td>
		<td class="col_value" nowrap>
			<html:text property="addr3" styleClass="textbox1" readonly="<%=formReadOnly%>" maxlength="<%=colSize%>" size="<%=displaySize%>" value="<%=CommonUtil.nullToString(companyMaintenanceForm.getAddr3())%>"/>
		</td>
		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_FAX");
		colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_FAX"));
		displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_FAX"));
		%>
		<td class="col_label">
			<bean:message key="label.general.mandatory.field"/>
			<span class="mandatory_label"><%=webLabel%></span>
		</td>
		<td class="col_value" nowrap>
			<%--
			<html:text property="fax" styleClass="textbox1" readonly="<%=formReadOnly%>" maxlength="<%=colSize%>" size="<%=displaySize%>" value="<%=CommonUtil.nullToString(companyMaintenanceForm.getFax())%>"/>
			--%>
			<nobr>
			<%
			colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_FAX_COUNTRY"));
			displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_FAX_COUNTRY"));
			%>
			<html:text property="faxCountry" styleClass="textbox1" readonly="<%=formReadOnly%>" size="<%=displaySize%>" maxlength="<%=colSize%>" value="<%=CommonUtil.nullToString(companyMaintenanceForm.getFaxCountry())%>"/>
			+
			<%
			colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_FAX_AREA"));
			displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_FAX_AREA"));
			%>
			<html:text property="faxArea" styleClass="textbox1" readonly="<%=formReadOnly%>" size="<%=displaySize%>" maxlength="<%=colSize%>" value="<%=CommonUtil.nullToString(companyMaintenanceForm.getFaxArea())%>"/>
			+
			<%
			colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_FAX"));
			displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_FAX"));
			%>
			<html:text property="fax" styleClass="textbox1" readonly="<%=formReadOnly%>" size="<%=displaySize%>" maxlength="<%=colSize%>" value="<%=CommonUtil.nullToString(companyMaintenanceForm.getFax())%>"/>
			</nobr>
		</td>
	</tr>
	<tr>
		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_ADDR4");
		colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_ADDR4"));
		displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_ADDR4"));
		%>
		<td class="col_label">
			<%=webLabel%>
		</td>
		<td class="col_value" nowrap>
			<html:text property="addr4" styleClass="textbox1" readonly="<%=formReadOnly%>" maxlength="<%=colSize%>" size="<%=displaySize%>" value="<%=CommonUtil.nullToString(companyMaintenanceForm.getAddr4())%>"/>
		</td>
		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_POSTAL_CODE");
		colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_POSTAL_CODE"));
		displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_POSTAL_CODE"));
		%>
		<td class="col_label">
			<%=webLabel%>
		</td>
		<td class="col_value" nowrap>
			<html:text property="postalCode" styleClass="textbox1" readonly="<%=formReadOnly%>" maxlength="<%=colSize%>" size="<%=displaySize%>" value="<%=CommonUtil.nullToString(companyMaintenanceForm.getPostalCode())%>"/>
		</td>
	</tr>
	<tr>		
		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_LEDGER_CODE");
		colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_LEDGER_CODE"));
		displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_LEDGER_CODE"));
		%>
		<td class="col_label">
			<bean:message key="label.general.mandatory.field"/>
			<span class="mandatory_label"><%=webLabel%></span>
		</td>
		<td class="col_value" nowrap>
			<html:text property="ledgerCode" styleClass="textbox1" readonly="<%=formReadOnly%>" maxlength="<%=colSize%>" size="<%=displaySize%>" value="<%=CommonUtil.nullToString(companyMaintenanceForm.getLedgerCode())%>"/>
		</td>		
		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_PRIVACY_CODE");
		colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_PRIVACY_CODE"));
		displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_PRIVACY_CODE"));
		%>
		<td class="col_label">
			<%=webLabel%>
		</td>
		<td class="col_value" nowrap>
			<html:text property="privacyCode" styleClass="textbox1" readonly="<%=formReadOnly%>" maxlength="<%=colSize%>" size="<%=displaySize%>" value="<%=CommonUtil.nullToString(companyMaintenanceForm.getPrivacyCode())%>"/>
		</td>		
	</tr>
	<tr>		
		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_CCY");
		colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_CCY"));
		displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_CCY"));
		%>
		<td class="col_label">
			<bean:message key="label.general.mandatory.field"/>
			<span class="mandatory_label"><%=webLabel%></span>
		</td>
		<td class="col_value" nowrap>
			<select name="ccy"  <%=formReadOnly ? "disabled=\"true\"" : ""%> class="selectBox1">
			<% where = "ref_master_code='" + ProjectConstants.CD_CCY + "' AND COMPANY_CODE = '"+WebUtil.getAppropriateCompanyCode(session, null) + "' AND REF_STATUS = '"+ProjectConstants.GENERIC_ACTIVE+"' ";%>
				<option value="">
				<chtml:options table="T_CODE_DTL"
				valuecolumn="REF_CODE"
				textcolumn="REF_DESC"
				where= "<%=where%>"
				order="REF_DESC"
				selected="<%=companyMaintenanceForm.getCcy()%>" />
			</select>
		</td>
		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_BASE_CCY");
		colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_BASE_CCY"));
		displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_BASE_CCY"));
		%>
		<td class="col_label">
			<bean:message key="label.general.mandatory.field"/>
			<span class="mandatory_label"><%=webLabel%></span>
		</td>
		<td class="col_value" nowrap>
			<select name="baseCcy"  <%=formReadOnly ? "disabled=\"true\"" : ""%> class="selectBox1">
			<% where = "ref_master_code='" + ProjectConstants.CD_CCY + "' AND COMPANY_CODE = '"+WebUtil.getAppropriateCompanyCode(session, null) + "' AND REF_STATUS = '"+ProjectConstants.GENERIC_ACTIVE+"' ";%>
				<option value="">
				<chtml:options table="T_CODE_DTL"
				valuecolumn="REF_CODE"
				textcolumn="REF_DESC"
				where= "<%=where%>"
				order="REF_DESC"
				selected="<%=companyMaintenanceForm.getBaseCcy()%>" />
			</select>
		</td>		
	</tr>
	<tr>
		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_COMPANY_LOGO");
		colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_COMPANY_LOGO"));
		displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_COMPANY_LOGO"));
		%>
		<td class="col_label">
			<%=webLabel%>
		</td>
		<td class="col_value" nowrap>
		<% if(companyMaintenanceForm.getCompanyLogo() == null) { %>
			<chtml:button form="companyMaintenanceForm" pageEvent="<%=CompanyMaintenanceAction.ACTION_ADD_COMP_LOGO%>"
			styleClass="button1"/>
		<% } else { %>
			<input type="button" value="View" class="button1" onClick="javascript:doViewImage('<%=CompanyMaintenanceAction.ACTION_VIEW_COMP_LOGO%>');">
			<chtml:button form="companyMaintenanceForm" pageEvent="<%=CompanyMaintenanceAction.ACTION_DEL_COMP_LOGO%>"
			styleClass="button1"/>
		<% } %>
		</td>
		<td class="col_label">
		</td>
		<td class="col_value" nowrap>

		</td>
	</tr>
	<tr>
		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_CREATE_USER");
		colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_CREATE_USER"));
		displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_CREATE_USER"));
		%>
		<td class="col_label">
			<%=webLabel%>
		</td>
		<td class="col_value" nowrap>
			<bean:write name="companyMaintenanceForm" property="createUser" filter="true"/>
		</td>
		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_CREATE_DATE");
		colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_CREATE_DATE"));
		displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_CREATE_DATE"));
		%>
		<td class="col_label">
			<%=webLabel%>
		</td>
		<td class="col_value" nowrap>
			<%--<bean:write name="companyMaintenanceForm" property="createDate" filter="true"/>--%>
			<%=CommonUtil.dateToString(CommonUtil.stringToTimestamp(
            companyMaintenanceForm.getCreateDate()), ProjectConstants.OUTPUT_DATETIME_FORMAT)%>
		</td>
	</tr>
	<tr>
		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_UPDATE_USER");
		colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_UPDATE_USER"));
		displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_UPDATE_USER"));
		%>
		<td class="col_label">
			<%=webLabel%>
		</td>
		<td class="col_value" nowrap>
			<bean:write name="companyMaintenanceForm" property="updateUser" filter="true"/>
			

		</td>

		<%
		webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_COMPANY_UPDATE_DATE");
		colSize = String.valueOf(ts.getColSizeByObjectId("LBL_COMPANY_UPDATE_DATE"));
		displaySize = String.valueOf(ts.getDisplaySizeByObjectId("LBL_COMPANY_UPDATE_DATE"));
		%>
		<td class="col_label">
			<%=webLabel%>
		</td>
		<td class="col_value" nowrap>
			<%--<bean:write name="companyMaintenanceForm" property="updateDate" filter="true"/>--%>
			<%=CommonUtil.dateToString(CommonUtil.stringToTimestamp(
            companyMaintenanceForm.getUpdateDate()), ProjectConstants.OUTPUT_DATETIME_FORMAT)%>

		</td>
</table>

